package com.yangye.pidoublename.service;

import org.apache.commons.lang3.StringUtils;

/**
 * @author yangye
 * @date 2019/9/18
 */
public enum ProvinceEnum {
	JIANGSU("jiangsu", "江苏省", "jiangSuServiceImpl"),
	HEILONGJIANG("heilongjiang", "黑龙江省", "heiLongJiangServiceImpl"),
	SICHUAN("sichuan", "四川省", "siChuanServiceImpl"),
	ANHUI("anhui", "安徽省", "anHuiServiceImpl"),
	GUANGDONG("guangdong", "广东省", "guangDongServiceImpl"),
	CHONGQING("chongqing", "重庆市", "chongQingServiceImpl"),
	HENAN("henan", "河南省", "heNanServiceImpl"),
	JILIN("jilin", "吉林省", "jiLinServiceImpl"),
	SHANDONG("shandong", "山东省", "shanDongServiceImpl"),
	BEIJING("beijing", "北京市", "beiJingServiceImpl"),
	SHANGHAI("shanghai", "上海市", "shangHaiServiceImpl");


	private String code;
	private String name;
	private String beanName;

	ProvinceEnum(String code, String name, String beanName) {
		this.code = code;
		this.name = name;
		this.beanName = beanName;
	}

	public static ProvinceEnum getByCode(String code) {
		for (ProvinceEnum value : values()) {
			if (StringUtils.equals(code, value.getCode())) {
				return value;
			}
		}
		return null;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getBeanName() {
		return beanName;
	}

	public void setBeanName(String beanName) {
		this.beanName = beanName;
	}
}
